package org.nashua.toughtechs151.dash;

import org.nashua.toughtechs151.ChocolateChip;

public class Dash implements ConnectionListener {
	public ClientConnection conn;
	public Data data;
        private ChocolateChip cc;
	public Dash(ChocolateChip cc) throws Exception{
		conn = new ClientConnection("10.1.52.5",1735,this);
		data = new Data(conn,cc);
                this.cc=cc;
	}
	public void onConnect() {
            System.out.println("[Connected]");
	}
	public void onDisconnect() {
            System.out.println("[Disconnected]");
	}
	public void onDataRecieved(String str) {
            if (str.equals("[Disconnect]")) conn.disconnect();
	}
}
